<?php
/**
 * Created by PhpStorm.
 * User: fengliu
 * Date: 15/8/5
 * Time: 下午11:59
 */

namespace Api\Controller;


class MediaController extends BaseController
{
    public function getList()
    {
        $perPage = I('post.perPage',5,'intval');
        $page=I('post.page',1,'intval');
        $model=M('Video');
        $count = $model->count();
        $maxPage=$count/$perPage;
        if($page!=1 && $page>$maxPage)
            $this->error('没有此页面');
        $list = $model->page($page, $perPage)->select();
        if(!empty($list))
            $this->success('操作成功',null,array('count'=>$count,'list'=>$list));
        else
            $this->error('暂无数据!');
    }
}